﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
					xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
					xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
					xmlns:Configuration="clr-namespace:Multitouch.Configuration;assembly=Multitouch.Configuration"
					mc:Ignorable="d">
	<DataTemplate x:Key="SelectedInputProviderTemplate" DataType="{x:Type Configuration:InputProvider}">
		<Border x:Name="Bd" SnapsToDevicePixels="true">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="*"/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" MinWidth="48.954"/>
					<ColumnDefinition Width="*"/>
				</Grid.ColumnDefinitions>
				<TextBlock Text="{Binding Path=Name, Mode=Default, FallbackValue=No active device}" TextWrapping="Wrap" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" d:LayoutOverrides="Width" Margin="5,5,5,5"/>
				<TextBlock Style="{DynamicResource LabelStyle}" Grid.Row="1"><Run Text="Description:"/></TextBlock>
				<TextBlock Grid.Row="2" Style="{DynamicResource LabelStyle}"><Run Text="Publisher:"/></TextBlock>
				<TextBlock Grid.Row="3" Style="{DynamicResource LabelStyle}"><Run Text="Version:"/></TextBlock>
				<TextBlock Grid.Column="1" Style="{DynamicResource ValueStyle}" Text="{Binding Path=Description, Mode=Default, FallbackValue=NA}" Grid.Row="1"/>
				<TextBlock Grid.Column="1" Grid.Row="2" Style="{DynamicResource ValueStyle}" Text="{Binding Path=Publisher, Mode=Default, FallbackValue=NA}" />
				<TextBlock Grid.Column="1" Grid.Row="3" Style="{DynamicResource ValueStyle}" Text="{Binding Path=Version, Mode=Default, FallbackValue=NA}"/>
			</Grid>
		</Border>
	</DataTemplate>
	<DataTemplate x:Key="DefaultInputProviderTemplate" DataType="{x:Type Configuration:InputProvider}">
		<TextBlock Text="{Binding Name}" Margin="5" FontWeight="Bold" FontSize="14"/>
	</DataTemplate>
	<Style x:Key="LabelStyle" TargetType="{x:Type TextBlock}">
		<Setter Property="HorizontalAlignment" Value="Right"/>
		<Setter Property="VerticalAlignment" Value="Top"/>
		<Setter Property="Margin" Value="5,5,5,5"/>
	</Style>
	<Style x:Key="ValueStyle" TargetType="{x:Type TextBlock}">
		<Setter Property="HorizontalAlignment" Value="Left"/>
		<Setter Property="VerticalAlignment" Value="Top"/>
		<Setter Property="Margin" Value="5,5,5,5"/>
		<Setter Property="TextWrapping" Value="Wrap"/>
	</Style>
	<Style x:Key="InputProviderContainerStyle" TargetType="{x:Type ListBoxItem}">
		<Style.Triggers>
			<Trigger Property="Selector.IsSelected" Value="True">
				<Setter Property="ContentTemplate" Value="{DynamicResource SelectedInputProviderTemplate}"/>
			</Trigger>
		</Style.Triggers>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="Padding" Value="2,0,0,0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ListBoxItem}">
					<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="Selector.IsSelected" Value="True">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="ContentTemplate" Value="{DynamicResource DefaultInputProviderTemplate}"/>
	</Style>
	<ControlTemplate x:Key="ActivateButtonTemplate" TargetType="{x:Type Button}">
		<Viewbox Stretch="Fill">
			<Grid Width="100" Height="100" x:Name="grid">
				<Ellipse Fill="#CC494848" Margin="0,0,-5,-5" x:Name="shadow"/>
				<Ellipse Stroke="#FF323232" StrokeThickness="1" Fill="#FFFFFFFF" x:Name="border"/>
				<Ellipse StrokeThickness="5" Margin="7,7,7,7" x:Name="background">
					<Ellipse.Fill>
						<RadialGradientBrush>
							<GradientStop Color="#FF3D7FF4" Offset="1"/>
							<GradientStop Color="#FF8AB4FF" Offset="0"/>
						</RadialGradientBrush>
					</Ellipse.Fill>
				</Ellipse>
				<Path Stretch="Fill" Stroke="#FFFFFFFF" StrokeThickness="15" Data="M0,0 L1,0.5 0,1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Margin="32,15,23,15" x:Name="arrow"/>
			</Grid>
		</Viewbox>
		<ControlTemplate.Triggers>
			<Trigger Property="IsPressed" Value="True">
				<Setter Property="Visibility" TargetName="shadow" Value="Hidden"/>
				<Setter Property="Margin" TargetName="grid" Value="5,5,-5,-5"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="False">
				<Setter Property="Stroke" TargetName="arrow" Value="#FFA5A5A5"/>
				<Setter Property="Fill" TargetName="border" Value="#FFA5A5A5"/>
				<Setter Property="Fill" TargetName="background">
					<Setter.Value>
						<RadialGradientBrush>
							<GradientStop Color="#FF2E5CAD" Offset="1"/>
							<GradientStop Color="#FF6789C4" Offset="0"/>
						</RadialGradientBrush>
					</Setter.Value>
				</Setter>
				<Setter Property="Fill" TargetName="shadow" Value="#CC323232"/>
				<Setter Property="Visibility" TargetName="shadow" Value="Hidden"/>
				<Setter Property="Margin" TargetName="grid" Value="5,5,-5,-5"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
</ResourceDictionary>